/**
 *  This file only for common function that needs to be shared with other product. 
 *  Please add other common function  in validation.js for widget framework usage.
 */
//this function can check whether a string only contains number or dot
function isNumericOrDot(strText){
   var strValidChars = "0123456789.";
   var isNumber=true;
   var strChar;

   for (i = 0; i < strText.length && isNumber; i++){
      strChar = strText.charAt(i);
      if (strValidChars.indexOf(strChar) == -1){
         return false;
     }
   }
   return isNumber;
}

//this function can check whether a variable is empty
function isEmpty(obj){
   return  obj == undefined || obj== null || obj== "";
}

//this function can trim space in the front of string and in the end of string
function trimString(strText){
    if (strText){
	    return(strText.replace(/^\s+|\s+$/g, ''));
    }else{
        return strText;
    }
}